<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css">
    <link rel="stylesheet" href="/resource/js/front/index.css">
</head>
<style>
    .house-userPer .user-person ul li {
        width: 214px
    }

    .editInfo {
        width: 100%;
        height: 110px;
        color: #84a3bf;
        border: none;
        border-radius: 0;
        border-right: 1px solid #e6e6e6;
        border-left: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
</style>
<body>
<div th:replace="front/head :: heads"></div>
<div class="layui-container userpublic useradd">
    <div class="layui-row layui-col-space20">
        <p class="layui-hide-xs title">首页 &gt; <span> </span></p>
        <div th:replace="front/head :: info-nav"></div>
        <div class="layui-col-sm10">
            <table class="layui-table" id="user-address" lay-filter="user-address"></table>
            <button class="layui-btn layui-btn-primary address-add editInfo"><i
                    class="layui-icon layui-icon-add-1">添加按钮</i>
            </button>
        </div>
    </div>
</div>
<script type="text/html" id="addressTpl">
    {{#  if(d.default=='0'){ }}
    <span id="  " lay-event="edit" style="cursor: pointer;color: #e6d6bc">默认</span>
    {{#  } }}
    <span id="del" lay-event="del" style="cursor: pointer;color: #e6d6bc">删除</span>
    <!--<span id="del" lay-event="del" style="cursor: pointer;color: #e6d6bc">编辑</span>-->
</script>
<!-- layui.js -->
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript" src="/resource/js/front/house.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script th:inline="javascript">
    layui.use(['table', 'layer', 'laydate', 'form'], function () {
        var alerts = [[${alerts}]]
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            form = layui.form
        if (alerts != '' && alerts != null) {
            layer.alert(alerts)
        }
        form.on('submit(bound)', function (data) {
            $.ajax({
                url: '/bound',
                type: 'post',
                data: data.field,
                dataType: 'json',
                async: false,
                success: function (result) {
                    if (result.status) {
                        layer.alert("绑定成功!", {
                            time: 1000,
                            end: function () {
                                location.reload()
                            }
                        })
                    } else {
                        layer.msg(result.msg);
                    }
                    form.render();
                }

            });
        });
        form.on('submit(top_up)', function (data) {
            $.ajax({
                url: '/recharge',
                type: 'post',
                data: data.field,
                dataType: 'json',
                async: false,
                success: function (result) {
                    if (result.status) {
                        layer.alert("充值成功!", {
                            time: 1000,
                            end: function () {
                                location.reload()
                            }
                        })
                    } else {
                        layer.msg(result.msg);
                    }
                    form.render();
                }

            });
        });
    });
</script>

</body>
</html>